package com.itheima.idea;

public class Demo4 {
    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5,6,7,8,9};
        for(int start = 0,end = arr.length-1;start<end;start++,end--){
            int temp =arr[end];
            arr[end]=arr[start];
            arr[start]=temp;
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]+" ");
        }
    }
}
